//
//  ORRefreshTableView.m
//  News
//
//  Created by rimi on 2016/12/6.
//  Copyright © 2016年 dongfumei. All rights reserved.
//

#import "ORRefreshTableView.h"


@implementation ORRefreshTableView


- (void)addFooter:(FootRefresh)footer {
    // 弱引用
    __weak typeof(self) weakSelf = self;
    self.mj_footer = [MJRefreshBackStateFooter footerWithRefreshingBlock:^{
        footer((MJRefreshBackStateFooter *)weakSelf.mj_footer);
    }];
    [(MJRefreshBackStateFooter *)self.mj_footer setTitle:@"ghost" forState:MJRefreshStateIdle];
}


- (void)addHeader:(HeaderRefresh)header {
    __weak typeof(self) weakSelf = self;
    self.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
        header((MJRefreshNormalHeader *)weakSelf.mj_header);
    }];
}

@end
